#include<graphics.h>
#include<conio.h>
#include<stdio.h>
int main()
{
	int cricle_x=100, cricle_y=100,radius=100,n;
	float PI = 3.14;
	initgraph(800, 800);
	setbkcolor(BLACK);
	cleardevice();
	solidcircle(cricle_x, cricle_y, radius);
	float offest=PI/15,p=PI/40;
	
		while (1)
		{
			for (cricle_x = 100; cricle_x <= 700; cricle_x = cricle_x + 200)
			{

				for (cricle_y = 100; cricle_y <= 700; cricle_y = cricle_y + 200)
				{
					float h = rand() % 180;
					h = rand() % 180;

					COLORREF color1 = HSVtoRGB(h, 0.9, 0.8);
					COLORREF color2 = HSVtoRGB(h + 180, 0.9, 0.8);
					for (radius = 100; radius > 0; radius = radius - 25)
						for (n = 0; n <= 30; n = n + 1)
						{
							offest = n * PI / 30 + p;
							setfillcolor(BLACK);
							solidpie(cricle_x - radius, cricle_y - radius, cricle_x + radius, cricle_y + radius, PI / 60 + offest, 2 * PI / 60 + offest);
							setfillcolor(color1);
							solidpie(cricle_x - radius, cricle_y - radius, cricle_x + radius, cricle_y + radius, 2 * PI / 60 + offest, 3 * PI / 60 + offest);
							setfillcolor(WHITE);
							solidpie(cricle_x - radius, cricle_y - radius, cricle_x + radius, cricle_y + radius, 3 * PI / 60 + offest, 4 * PI / 60 + offest);
							setfillcolor(color2);
							solidpie(cricle_x - radius, cricle_y - radius, cricle_x + radius, cricle_y + radius, 4 * PI / 60 + offest, 5 * PI / 60 + offest);
							p = PI / 30 + p;
						}
				}
			}_getch();
		}
		return 0;
}